package com.lhl.biz.template.api.shared.domain.entity;

import com.lhl.biz.template.api.shared.domain.dto.ComDTO;
import com.lhl.fw.db.entity.AbstractAuditEntity;
import com.lhl.fw.db.entity.BaseEntity;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * @className: Template
 * @description: TODO 类描述
 * @author: king
 * @date: 2020-06-17 11:32
 **/
@Table(name = "DM_TEMPLATE")
@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class Template extends AbstractAuditEntity<String> {
    @ApiModelProperty(value = "名字", example = "名字")
    @Column(name = "NAME")
    private String name;
    @ApiModelProperty(value = "生日")
    @Column(name = "BIRTHDAY")
    private LocalDate birthday;
    @ApiModelProperty(value = "备注对象")
    @Type(type = "json")
    @Column(name = "REMARKS", columnDefinition = "json")
    private ComDTO remarks;
    @ApiModelProperty(value = "集合")
    @Type(type = "json")
    @Column(name = "DEMO", columnDefinition = "json")
    private List<ComDTO> demo;
    @ApiModelProperty(value = "MAP")
    @Type(type = "json")
    @Column(name = "DEMO_MAP", columnDefinition = "json")
    private Map<String, ComDTO> demoMap;
}
